<?php
session_start();
?>
<?php
$consultacad = "SELECT * FROM tbempresa WHERE codempresaliteci ='".$_SESSION['codcli']."'";
$exec = mysql_query($consultacad);
$res = mysql_fetch_array($exec);
$rzsoci   = $res[1];
$fantasia = $res[3];
$endereco = $res[6];
$num      = $res[7];
$bairro   = $res[8];
$cidade   = $res[9];
$tel1     = $res[12];
$tel2     = $res[13];
$email    = $res[17];

?>
  <SCRIPT language=Javascript>
      <!--
      function isNumberKey(evt)
      {
         var charCode = (evt.which) ? evt.which : event.keyCode
         if (charCode != 46 && charCode > 31 && (charCode < 48 || charCode > 57))
            return false;

         return true;
         if(event==true){}
      }
      //-->
   </SCRIPT>
   <script type="text/javascript">
function formatar_mascara(src, mascara) {
	var campo = src.value.length;
	var saida = mascara.substring(0,1);
	var texto = mascara.substring(campo);
	if(texto.substring(0,1) != saida) {
		src.value += texto.substring(0,1);
	}
}
</script>
<link rel="stylesheet" type="text/css" href="css/default.css" media="all" />﻿
<div id="rightContent">
    <form action="nav/atualizadados.php" method="post" enctype="multipart/form-data">
<table width="657" height="377" border="0">
<tr>
    <td colspan="2" align="center";>Atualização dos Dados  de Sua Empresa:</td>
  </tr>
  <tr>
    <td width="90">Razão:</td>
    
    <td width="547"><input type="text" id="razao" name="razao" class="rzEm" value="<?php echo $rzsoci;?>" /></td>
  </tr>
  <tr>
    <td>Fantasia:</td>
    <td><input type="text" id="fantasia" name="fantasia" class="rzEm" value="<?php echo $fantasia; ?>" /></td>
  </tr>
  <tr>
    <td>Endereço:</td>
    <td><input type="text" id="endereco" name="endereco" class="rzEm" value="<?php echo $endereco; ?>"/></td>
  </tr>
  <tr>
    <td>Número:</td>
    <td><input type="text" id="num" name="num" class="num" value="<?php echo $num; ?>" onkeypress="return isNumberKey(event)" /></td>
  </tr>
  <tr>
    <td>Bairro:</td>
    <td><input type="text" id="bairro" name="bairro" class="rzEm" value="<?php echo $bairro; ?>" /></td>
  </tr>
  <tr>
    <td>Cidade:</td>
    <td><input type="text" id="cidade" name="cidade" class="rzEm" value="<?php echo $cidade; ?>" /></td>
  </tr>
  <tr>
    <td>Fone 1:</td>
    <td><input type="text" id=telefone1 name="telefone1" value="<?php echo $tel1?>" onkeypress="formatar_mascara(this, '##-####-####')"  maxlength="12"  /> (81) 3333 - 5555</td>
  </tr>
  <tr>
    <td>Celular:</td>
    <td><input type="text" id="telefone2" name="telefone2" value="<?php echo $tel2; ?>" onkeypress="formatar_mascara(this, '##-####-####')" maxlength="12"  /> (81) 3333 - 5555</td>
  </tr>
  <tr>
    <td>Email:</td>
    <td><input type="text" id="email" name="email" value="<?php echo $email; ?>" class="rzEm" /></td>
  </tr>
    <tr>
    <td colspan="2" align="left"><input type="submit" name="enviar" id="enviar"  value="Atualizar Dados" /></td>
    <?php
    if(($_SESSION['atualizado']=='S')){?>
       <td colspan="2" align="right"><input type="button" name="acessar" id="acessar" value="Atualizar Usuario" onclick="location.href='http://www.liteci.info/clientes/home.php?id=nav/AtualizaUsuario'"/></td>
       <td colspan="2" align="right"><input type="button" name="acessar" id="acessar"  value="Novo Usuário" onclick="location. href= 'http://www.liteci.info/clientes/home.php?id=nav/cadusuario'"/></td>
        <?php } ?>
    </tr>
  </table>
  </form>
   </div>